<?php $this->_extends('_layouts/default_layout'); ?>
<?php echo $this->_block('title')?>
<?php echo '会员中心推荐赚钱',$config['sitename'] ?>
<?php echo $this->_endblock()?>
<?php echo $this->_block('meta')?>
<link rel="stylesheet"
	type="text/css" href="<?php echo $_BASE_DIR; ?>css/global.css" />
<link rel="stylesheet"
	href="<?php echo $_BASE_DIR; ?>images/account_con.css" type="text/css">
	
	<script type="text/javascript" src="<?php echo $_BASE_DIR?>javascripts/jquery.min.js"></script>
<?php echo $this->_endblock()?>
<?php $this->_block('center'); ?>
<div>
	<img src="<?php echo $_BASE_DIR; ?>images/account_con_03.jpg">
</div>
<div id="maincon_c">
<?php $this->_element('userleft') ?>
	<div id="maincon_c_r">
			
				<div id="pwd_protect_title">
				<h3>赠送积分</h3>
				</div>
				<hr>
				<p id="p_step1">您的积分余额:<font color="red"><span id="userpoint"><?php echo $userdata->userpoint;?></span></font>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red"><span id="send_err"></span></font></p>
				
			
			<div id="msg"></div>
			<div id="step1">
				
				<div class="clear"></div>
				
				
				<form onsubmit="configSendpoint();return false;">
					<table class="getbind_table" border="0" cellpadding="0" cellspacing="0">
						
						<tbody>
						<tr>
							<td style="text-align: right;"><strong>赠送的账号：</strong></td>
							<td><input name="target_phone" id="target_phone" maxlength="20" class="getback" type="text"></td>
							<td></td>
						</tr>
						<tr>
							<td style="text-align: right;"><strong>赠送的积分：</strong></td>
							<td><input name="point" id="point" maxlength="20" class="getback" type="text"></td>
							<td></td>
						</tr>
					</tbody></table>
					<div class="clear"></div>
					<br>
					<div id="account_vouch_btnzone">
						<input  id="next" value="确认赠送" type="submit">
					</div>
					
				</form>
				
			</div>
			
			
				<br>
				<hr><br>
				<strong>赠送介绍：</strong><br>
				<p>一个账号可以给任意账号赠送积分,但是平台会收取10%的手续费!</p>
				
			</div>
			<div class="clear"></div>
</div>

<div style="margin-bottom: 10px;">
	<img src="<?php echo $_BASE_DIR; ?>images/account_con_15.jpg">
</div>
<script>
function configSendpoint()
{
	var target_phone = document.getElementById('target_phone');
	var point = document.getElementById('point');
	var send_err = document.getElementById('send_err');
	if (target_phone.value == '')
	{
		send_err.innerHTML='您必须输入要赠送的账号';
		target_phone.focus();
		}else if(point.value == '')
		{
			send_err.innerHTML = '您必须输入要赠送的积分';
			point.focus();
			}else if (parseInt(point.value) < 100)
			{
				send_err.innerHTML = '对不起,赠送的积分必须大于100';
				point.focus();
				}
			else if(confirm('确定要赠送 :' + target_phone.value + ',' + point.value + '点积分吗?'))				
			{
				$.post(
						'<?php echo url("users/sendpoint")?>',
						'target_phone='+target_phone.value+'&'+'point='+point.value,
						function(data){
							if(data.status)
							{
								send_err.innerHTML = '';
								alert('赠送成功,您当前的积分余额为:'+data.result);
								$('#userpoint').html(data.result);
								
								}else
								{
								alert(data.message);
									}
							},
						'json'
						);
				}
	}
</script>
<?php $this->_endblock(); ?>
